package com.tang.web_standard.domain;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/16 20:11
 * @Desc
 * @Remarks
 */

/**
 * 其他的校验请参考javax.validation.constraints包下的其他注解
 */
@Data
public class User {

    @NotNull(message = "name不能为空！")
    private String name;

    @Min(value = 0, message = "age不能为负数")
    @Max(value = 200, message = "age不能超过200")
    @NotNull(message = "age不能为空！")
    private Integer age;

    @NotNull(message = "sex不能为空！")
    private Character sex;
}
